import java.util.Arrays;

public class SolutionInterview17_14 {
    public int[] smallestK(int[] arr, int k) {
        Arrays.sort(arr);
        return Arrays.copyOfRange(arr,0,k);
    }

    public static void main(String[] args) {
        System.out.println(new SolutionInterview17_14().smallestK(new int[]{1,3,5,7,2,4,6,8},4)[1]);
    }
}
